import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建选课管理
export function createAdditionalCourses(data) {
  return request({
    url: adminUrl + '/study/additional-courses/create',
    method: 'post',
    data: data
  })
}

// 更新选课管理
export function updateAdditionalCourses(data) {
  return request({
    url: adminUrl + '/study/additional-courses/update',
    method: 'put',
    data: data
  })
}

// 删除选课管理
export function deleteAdditionalCourses(id) {
  return request({
    url: adminUrl + '/study/additional-courses/delete?id=' + id,
    method: 'delete'
  })
}

// 获得选课管理
export function getAdditionalCourses(id) {
  return request({
    url: adminUrl + '/study/additional-courses/get?id=' + id,
    method: 'get'
  })
}

// 获得选课管理分页
export function getAdditionalCoursesPage(query) {
  return request({
    url: adminUrl + '/study/additional-courses/page',
    method: 'get',
    params: query
  })
}

// 导出选课管理 Excel
export function exportAdditionalCoursesExcel(query) {
  return request({
    url: adminUrl + '/study/additional-courses/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
